package org.haredot.utils;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class JdbcPropertiesUtils {

    private static Properties p = new Properties();

    static {
        InputStream in = JdbcPropertiesUtils.class.getClassLoader().getResourceAsStream("jdbc.properties");

        try {
            p.load(in);
        } catch (IOException e) {
            throw new ExceptionInInitializerError("jdbc.properties 在 classpath 下 没有找到");
        }
    }

    public static String getProperty(String key) {
        return p.getProperty(key) ;
    }

    public static String getProperty(String key, String defaultValue) {
        return p.getProperty(key, defaultValue) ;
    }
}
